--- ksh-openbsd_cvs/jobs.c	2010-02-23 12:49:17.000000000 +0100
+++ ksh-openbsd_cvs.new/jobs.c	2010-04-01 21:01:24.133232595 +0200
@@ -21,6 +21,19 @@
 #include <sys/time.h>
 #include <sys/resource.h>
 #include "tty.h"
+#include "strlcpy.h"
+
+#ifndef CHILD_MAX
+# if defined(HAVE_SYSCONF) && defined(_SC_CHILD_MAX)
+#  define CHILD_MAX sysconf(_SC_CHILD_MAX)
+# else /* _SC_CHILD_MAX */
+#  ifdef _POSIX_CHILD_MAX
+#   define CHILD_MAX    ((_POSIX_CHILD_MAX) * 2)
+#  else /* _POSIX_CHILD_MAX */
+#   define CHILD_MAX    20
+#  endif /* _POSIX_CHILD_MAX */
+# endif /* _SC_CHILD_MAX */
+#endif /* !CHILD_MAX */
 
 /* Order important! */
 #define PRUNNING	0
